<template>
	<view class="main">
		<view class="MainContent">
			<view class="MainContent">
				<view class="teacherBox" v-for="item in collectList" :key="item._id" @click="ResumeDetail(item._id)">
					<view class="topContent">
						<view class="tlContent">
							<view class="Language">{{item.expertise}}翻译官</view>
							<view class="species">
								<view class="speciesTag">{{item.colleges}}</view>
								<view class="speciesTag">{{item.experience}}年经验</view>
								<view class="speciesTag">{{item.skills}}</view>
							</view>
						</view>
						<view class="trContent">
							<view class="price">
								<text class="ylogo">￥</text>
								<text>{{item.Price[0]}}</text>
								<text>-</text>
								<text>{{item.Price[1]}}</text>
							</view>
							<!-- <view class="timeDuration">已服务时长：3H</view> -->
						</view>
					</view>
					<view class="line"></view>
					<view class="bottomContent">
						<vie class="blContent">
			
							<image :src="getgenderImage(item.gender)" mode="" class="blImage"></image>
							<text class="name">{{item.name}}</text>
							<image :src="getLevelImage(item.level)" mode="" class="blImage2"></image>
						</vie>
						<vie class="brContent">
							<view class="brTxt">
								<text class="city">{{item.city[0]}}</text>-<text>在线接单中</text>
							</view>
						</vie>
					</view>
				</view>
			
			</view>
			<!-- 分割线 -->

		</view>
	</view>
</template>

<script>
	import {
		request,
		baseUrl
	} from '../../http/request.js';
	export default {
		data() {
			return {
					baseUrl: baseUrl,
				collectList: [],
				_id: "",
			}
		},
		onShow() {
			this._id = uni.getStorageSync('_id'),
				this.getCollect()
		},
		methods: {
			getgenderImage(gender) {
				switch (gender) {
					case '男':
						return this.baseUrl + 'images/static/home/man.png';
					case '女':
						return this.baseUrl + 'images/static/home/woman.png';
					default:
						return this.baseUrl + 'images/static/home/man.png';
				}
			},
			getLevelImage(level) {
				switch (level) {
					case '1':
						return this.baseUrl + 'images/static/home/bz.png';
					case '2':
						return this.baseUrl + 'images/static/home/zy.png';
					case '3':
						return this.baseUrl + 'images/static/home/zs.png';
					default:
						return this.baseUrl + 'images/static/home/bz.png'; // 或者您可以返回一个默认图片路径
				}
			},
			getCollect() {
				console.log('this._id', this._id)
				this.$http.LoginHttp.getCollect({
					_id: this._id
				}).then(res => {
					console.log("收藏列表", res)
					this.collectList = res.teachers
				}).catch(Error => {
					console.log("错误信息")
				})
			},
			//收藏跳转
			//用户详情页面
			ResumeDetail(_id) {
				uni.navigateTo({
					// url: '../resume/resume?_id=' + encodeURIComponent(_id),
					url:'/pagesResume/resume/resume?_id=' + encodeURIComponent(_id),

				});
			},
		}
	}
</script>

<style lang="scss">
	.main {
		padding: 30rpx 30rpx;
	}
.MainContent {
		width: 100%;
		.teacherBox {
			width: 686rpx;
			height: 218rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			border: 2rpx solid #EEEEEE;
			padding: 22rpx 22rpx;
			margin-bottom: 20rpx;

			.topContent {
				display: flex;
				justify-content: space-between;
				margin-bottom: 28rpx;

				.tlContent {
					.Language {
						height: 44rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: bold;
						font-size: 32rpx;
						color: #111111;
						line-height: 38rpx;
						margin-bottom: 16rpx;
					}

					.species {
						display: flex;

						.speciesTag {
							padding: 0rpx 12rpx;
							width: 120rpx;
							height: 36rpx;
							font-weight: 400;
							font-size: 20rpx;
							color: #F7A300;
							line-height: 36rpx;
							text-align: center;
							border-radius: 40rpx 40rpx 40rpx 40rpx;
							border: 1rpx solid #F7A300;
							margin-right: 10rpx;
							overflow: hidden;
						}
						.speciesTag:nth-child(1){
							width: 120rpx;
							overflow: hidden;
						}
					}
				}

				.trContent {
					.price {
						height: 44rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: bold;
						font-size: 32rpx;
						color: #00A0F7;
						line-height: 38rpx;
						text-align: right;
						margin-bottom: 16rpx;

						.ylogo {
							font-size: 20rpx;
						}
					}

					.timeDuration {
						height: 34rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #666666;
						line-height: 28rpx;
						text-align: right;
						font-style: normal;
						text-transform: none;
					}
				}
			}

			.line {
				width: 638rpx;
				height: 1rpx;
				background: #EEEEEE;
				margin-bottom: 16rpx;
				border-radius: 0rpx 0rpx 0rpx 0rpx;
			}

			.bottomContent {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.blImage {
					width: 40rpx;
					height: 40rpx;
					vertical-align: middle;
				}

				.name {
					height: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 20rpx;
					color: #333333;
					line-height: 23rpx;
					text-align: center;
					font-style: normal;
					text-transform: none;
					margin: 0rpx 16rpx;
				}

				.blImage2 {
					width: 70rpx;
					height: 24rpx;
					vertical-align: middle;
				}

				.brContent {
					height: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 20rpx;
					color: #666666;
					line-height: 28rpx;
					text-align: center;
					margin-top: 10rpx;
				}
			}

		}
	}

</style>